/**
 * 资料链接页
 */
package com.xiaomuwu.android.ui.webpage

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.webkit.WebViewClient
import androidx.fragment.app.Fragment
import com.xiaomuwu.android.R
import com.xiaomuwu.android.ui.Displayer
import kotlinx.android.synthetic.main.webpage_fragment.*

class WebpageFragment:Fragment() {

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        return inflater.inflate(R.layout.webpage_fragment,container,false)
    }

    override fun onActivityCreated(savedInstanceState: Bundle?) {
        super.onActivityCreated(savedInstanceState)
        downloadPage.setLayerType(View.LAYER_TYPE_HARDWARE,null)    //开启硬件加速 //check
        downloadPage.settings.javaScriptEnabled=true
        downloadPage.webViewClient= WebViewClient()
        downloadPage.loadUrl(Displayer.resLink!!)   // 加载资料链接页面
    }

}